webpackJsonp([9],{

/***/ "47gl":
/***/ (function(module, exports) {

module.exports = "query fetch {\n  data: Hidden_Trouble_InvestigationAggregate @_(get: \"groupedBy.enterprise_name\") {\n    groupedBy {\n      enterprise_name {\n        keys\n        values @_(map: \"groupedBy\") {\n          count\n          groupedBy {\n            top: list_level {\n              keys\n              values @_(map: \"count\") {\n                count\n              }\n            }\n            state {\n              keys\n              values @_(map: \"count\") {\n                count\n              }\n            }\n            level: Hidden_danger_level {\n              keys\n              values @_(map: \"count\") {\n                count\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"

/***/ }),

/***/ "8XBH":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js
var helpers_extends = __webpack_require__("4YfN");
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__("KH7x");
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// EXTERNAL MODULE: ./node_modules/_lodash@4.17.11@lodash/lodash.js
var lodash = __webpack_require__("psq8");
var lodash_default = /*#__PURE__*/__webpack_require__.n(lodash);

// EXTERNAL MODULE: ./src/common/anjian/dangerCheck/index.gql
var dangerCheck = __webpack_require__("47gl");
var dangerCheck_default = /*#__PURE__*/__webpack_require__.n(dangerCheck);

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/dangerCheck/index.vue




//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//





var LEVEL = [{
  D_text: '一般隐患',
  D_code: '1'
}, {
  D_text: '重大隐患',
  D_code: '2'
}];
var STATE = {
  1: '未整改',
  3: '已整改'
};
/* harmony default export */ var anjian_dangerCheck = ({
  data: function data() {
    var _this = this;

    return {
      LEVEL: LEVEL,
      STATE: STATE,
      input: false,
      rightData: [{
        font: 'yt-icon yt-icon-search',
        click: function click() {
          _this.input = !_this.input;
        }
      }],
      active: [],
      items: [],
      dic: [],
      search: ''
    };
  },

  computed: {
    currentItems: function currentItems() {
      var _this2 = this;

      if (!this.search) return this.items;
      return this.items.filter(function (item) {
        return item.enterpriseName.indexOf(_this2.search) > -1;
      });
    }
  },
  activated: function activated() {
    if (this.$router.$isBack) return;
    this.fetchData();
  },

  methods: {
    getValue: function getValue(v, top) {
      if (!top) return '0 条';
      return (top[v.D_code] || 0) + ' 条';
    },
    fetchData: function fetchData() {
      var _this3 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var p, _ref, _ref2, entList, dic, data, obj, items;

        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                p = [commonApi["a" /* commonApi */].search('ent_enterprise'), commonApi["a" /* commonApi */].dictionary('hierarchy'), commonApi["a" /* commonApi */].gql(dangerCheck_default.a)];
                _context.next = 3;
                return _this3.$Loading.apply(_this3, p);

              case 3:
                _ref = _context.sent;
                _ref2 = slicedToArray_default()(_ref, 3);
                entList = _ref2[0];
                dic = _ref2[1];
                data = _ref2[2].data;
                obj = lodash_default.a.zipObject(data.keys, data.values);
                items = [];

                lodash_default.a.forIn(obj, function (_ref3, key) {
                  var state = _ref3.state,
                      top = _ref3.top,
                      level = _ref3.level;

                  var ent = entList.find(function (v) {
                    return v.id === key;
                  });
                  var item = {
                    enterpriseId: ent ? ent.id : '',
                    enterpriseName: ent ? ent.EnterpriseName : '',
                    state: lodash_default.a.zipObject(state.keys, state.values) || {},
                    top: lodash_default.a.zipObject(top.keys, top.values) || {},
                    level: lodash_default.a.zipObject(level.keys, level.values) || {}
                  };
                  items.push(item);
                });
                _this3.items = items;
                _this3.dic = dic;

              case 13:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this3);
      }))();
    },
    goListPage: function goListPage(enterpriseId, state, listLevel, HiddenDangerLevel) {
      var a = state ? { state: state } : {};
      var b = listLevel ? { list_level: listLevel } : {};
      var c = HiddenDangerLevel ? { Hidden_danger_level: HiddenDangerLevel } : {};
      var d = { enterprise_name: enterpriseId };
      var param = extends_default()({}, a, b, c, d);
      this.$router.$push({ path: '/dangerCheck/list', query: param });
    },
    refresh: function refresh(search) {
      this.search = search;
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-61e3d25c","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/dangerCheck/index.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"隐患排查","scroll":"","rightData":_vm.rightData,"input":_vm.input},on:{"change":_vm.refresh}},[_c('yt-collapse',{attrs:{"list":_vm.currentItems,"label":"enterpriseName"},scopedSlots:_vm._u([{key:"default",fn:function(props){return _c('div',{},[_c('yt-cell',{attrs:{"border":"none","label":"未整改","isLink":""},on:{"click":function($event){return _vm.goListPage(props.enterpriseId, 1)}}},[_c('span',{staticClass:"c-blue"},[_vm._v(" "+_vm._s(props.state['1'] || 0)+" 条")])]),_vm._v(" "),_c('yt-cell',{attrs:{"border":"none","label":"已整改","isLink":""},on:{"click":function($event){return _vm.goListPage(props.enterpriseId, 2)}}},[_c('span',{staticClass:"c-blue"},[_vm._v(" "+_vm._s(props.state['2'] || 0)+" 条")])]),_vm._v(" "),_vm._l((_vm.dic),function(v,index2){return _c('yt-cell',{key:index2,attrs:{"border":"none","label":v.D_text,"isLink":""},on:{"click":function($event){return _vm.goListPage(props.enterpriseId, null, v.D_code)}}},[_c('span',{staticClass:"c-blue"},[_vm._v(_vm._s(_vm.getValue(v, props.top)))])])}),_vm._v(" "),_c('yt-cell',{attrs:{"border":"none","label":"一般隐患","isLink":""},on:{"click":function($event){return _vm.goListPage(props.enterpriseId, null, null, 1)}}},[_c('span',{staticClass:"c-blue"},[_vm._v(" "+_vm._s(props.level['1'] || 0)+" 条")])]),_vm._v(" "),_c('yt-cell',{attrs:{"border":"none","label":"重大隐患","isLink":""},on:{"click":function($event){return _vm.goListPage(props.enterpriseId, null, null, 2)}}},[_c('span',{staticClass:"c-blue"},[_vm._v(" "+_vm._s(props.level['2'] || 0)+" 条")])])],2)}}]),model:{value:(_vm.active),callback:function ($$v) {_vm.active=$$v},expression:"active"}})],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var common_anjian_dangerCheck = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/dangerCheck/index.vue
function injectStyle (ssrContext) {
  __webpack_require__("NLRO")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-61e3d25c"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  anjian_dangerCheck,
  common_anjian_dangerCheck,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var src_common_anjian_dangerCheck = __webpack_exports__["default"] = (Component.exports);


/***/ }),

/***/ "NLRO":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ })

});